package com.dai.zhenfujin.issue.activity.Vehicle;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.dai.zhenfujin.R;

/**
 * 二手车
 */
public class UsedCarActivity extends AppCompatActivity implements View.OnClickListener{



    private EditText etName;
    private ImageView ivProductPicture;
    private EditText etPrice;
    private EditText etTime;
    private EditText etMileage;
    private EditText etExpire;
    private EditText etStrongRisk;
    private EditText etEmissionStandard;
    private EditText etVehicleColor;
    private EditText etCity;
    private EditText etNature;
    private EditText etDisplacement;
    private EditText etHistory;
    private TextView etNumber;
    private EditText etDescribe;
    private TextView etDescribeNumber;


    private TextView tv1,tv2,tv3,tv4,tv5,tv6,tv7,tv8,tv9,tv10,tv11,tv12,tv13,tv14,tv15,tv16;

    private TextView tvTitle;
    private ImageView ivTitle;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_used_car);

        initView();
        initListener();
    }

    private void initListener() {
        ivTitle.setOnClickListener(this);
        tv1.setOnClickListener(this);
        tv2.setOnClickListener(this);
        tv3.setOnClickListener(this);
        tv4.setOnClickListener(this);
        tv5.setOnClickListener(this);
        tv6.setOnClickListener(this);
        tv7.setOnClickListener(this);
        tv8.setOnClickListener(this);
        tv9.setOnClickListener(this);
        tv10.setOnClickListener(this);
        tv11.setOnClickListener(this);
        tv12.setOnClickListener(this);
        tv13.setOnClickListener(this);
        tv14.setOnClickListener(this);
        tv15.setOnClickListener(this);
        tv16.setOnClickListener(this);
    }

    private void initView() {

        tvTitle = (TextView)findViewById(R.id.title_textview);
        tvTitle.setText("发布产品");
        ivTitle = (ImageView)findViewById(R.id.title_imageview);


        etName = (EditText) findViewById(R.id.issue_used_car_et_name);// 产品名称
        ivProductPicture = (ImageView) findViewById(R.id.issue_used_car_iv_product_picture);//产品图
        etPrice = (EditText) findViewById(R.id.issue_used_car_et_price);//价格
        etTime = (EditText) findViewById(R.id.issue_used_car_et_time);//上牌时间
        etMileage = (EditText) findViewById(R.id.issue_used_car_et_mileage);//行驶里程
        etExpire = (EditText) findViewById(R.id.issue_used_car_et_expire);//年检到期
        etStrongRisk = (EditText) findViewById(R.id.issue_used_car_et_strong_risk);//强险到期
        etEmissionStandard = (EditText) findViewById(R.id.issue_used_car_et_emission_standard);//排放标准
        etVehicleColor = (EditText) findViewById(R.id.issue_used_car_et_vehicle_color);//车身颜色
        etCity = (EditText) findViewById(R.id.issue_used_car_et_city);//所在城市
        etNature = (EditText) findViewById(R.id.issue_used_car_et_nature);//车辆性质
        etDisplacement = (EditText) findViewById(R.id.issue_used_car_et__displacement);//排量/变速
        etHistory = (EditText) findViewById(R.id.issue_used_car_et_history);//历史用途
        etNumber = (TextView) findViewById(R.id.issue_used_car_et_number);//字数
        etDescribe = (EditText) findViewById(R.id.issue_used_car_et_describe);//历史用途
        etDescribeNumber = (TextView) findViewById(R.id.issue_used_car_et_describe_number);//字数


        tv1 = (TextView)findViewById(R.id.product_launch_pl_tv1);
        tv2 = (TextView)findViewById(R.id.product_launch_pl_tv2);
        tv3 = (TextView)findViewById(R.id.product_launch_pl_tv3);
        tv4 = (TextView)findViewById(R.id.product_launch_pl_tv4);
        tv5 = (TextView)findViewById(R.id.product_launch_pl_tv5);
        tv6 = (TextView)findViewById(R.id.product_launch_pl_tv6);
        tv7 = (TextView)findViewById(R.id.product_launch_pl_tv7);
        tv8 = (TextView)findViewById(R.id.product_launch_pl_tv8);
        tv9 = (TextView)findViewById(R.id.product_launch_pl_tv9);
        tv10 = (TextView)findViewById(R.id.product_launch_pl_tv10);
        tv11 = (TextView)findViewById(R.id.product_launch_pl_tv11);
        tv12 = (TextView)findViewById(R.id.product_launch_pl_tv12);
        tv13 = (TextView)findViewById(R.id.product_launch_pl_tv13);
        tv14 = (TextView)findViewById(R.id.product_launch_pl_tv14);
        tv15 = (TextView)findViewById(R.id.product_launch_pl_tv15);
        tv16 = (TextView)findViewById(R.id.product_launch_pl_tv16);
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()){
            case R.id.title_imageview:
                finish();
                break;
            case R.id.product_launch_pl_tv1:
                tv1.setText("价格可议");
                break;
            case R.id.product_launch_pl_tv2:
                tv2.setText("4s店保养");
                break;
            case R.id.product_launch_pl_tv3:
                tv3.setText("随时看车");
                break;
            case R.id.product_launch_pl_tv4:
                tv4.setText("一手车");
                break;
            case R.id.product_launch_pl_tv5:
                tv5.setText("有加装");
                break;
            case R.id.product_launch_pl_tv6:
                tv6.setText("公里数低");
                break;
            case R.id.product_launch_pl_tv7:
                tv7.setText("油耗低");
                break;
            case R.id.product_launch_pl_tv8:
                tv8.setText("9成新");
                break;
            case R.id.product_launch_pl_tv9:
                tv9.setText("原车原版");
                break;
            case R.id.product_launch_pl_tv10:
                tv10.setText("原车漆");
                break;
            case R.id.product_launch_pl_tv11:
                tv11.setText("发变无敌");
                break;
            case R.id.product_launch_pl_tv12:
                tv12.setText("实表");
                break;
            case R.id.product_launch_pl_tv13:
                tv13.setText("车况优秀");
                break;
            case R.id.product_launch_pl_tv14:
                tv14.setText("缺钱贱卖");
                break;
            case R.id.product_launch_pl_tv15:
                tv15.setText("过磨合期");
                break;
            case R.id.product_launch_pl_tv16:
                tv16.setText("新欢轮胎");
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        tv1.setText("");
        tv2.setText("");
        tv3.setText("");
        tv4.setText("");
        tv5.setText("");
        tv6.setText("");
        tv7.setText("");
        tv8.setText("");
        tv9.setText("");
        tv10.setText("");
        tv11.setText("");
        tv12.setText("");
        tv13.setText("");
        tv14.setText("");
        tv15.setText("");
        tv16.setText("");
        tvTitle.setText("");
        finish();
    }
}
